package cn.lingyangwl.agile.system.model.entity;

import cn.lingyangwl.agile.model.BasePlusPO;
import cn.lingyangwl.agile.common.datasource.core.type.JsonLongSetTypeHandler;
import cn.lingyangwl.agile.model.constants.CommonCons;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.*;

import java.util.Set;

/**
 * 租户套餐
 *
 * @author shenguangyang
 */
@TableName(value = "sys_tenant_package", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SysTenantPackage extends BasePlusPO {

    /**
     * 套餐编号，自增
     */
    private Long id;

    /**
     * 套餐名，唯一
     */
    private String name;

    /**
     * 租户套餐状态
     *
     * {@link CommonCons.UseStats#DISABLE}
     */
    private String status;
    /**
     * 备注
     */
    private String remark;

    /**
     * 场景ID
     */
    private Long sceneId;

    /**
     * 关联的菜单编号
     */
    @TableField(typeHandler = JsonLongSetTypeHandler.class)
    private Set<Long> menuIds;

    public static LambdaQueryWrapper<SysTenantPackage> lqw() {
        return Wrappers.lambdaQuery();
    }
}
